package main

/**
https://blog.csdn.net/weixin_42056422/article/details/117194958
*/
import "fmt"

type Person struct {
	Name string
}

func (p *Person) say() {
	fmt.Println("My name is " + p.Name)
}

type Teacher struct {
	Person
}

func (f Teacher) teach() {
	fmt.Println("I am a teacher! And  My name is " + f.Name)
}

func main() {
	t := Teacher{Person{"Tom"}}
	t.say()
	t.teach()

}
